package 笔试.远景.第一题;

import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int cnt1=0;//""
        int flag2=0;//{}
        int flag3=0;//[]
        for (int i = 0; i < line.length(); i++)
        {
            if (line.charAt(i)=='"')
                cnt1++;
            else if (line.charAt(i)=='{')
                flag2++;
            else if (line.charAt(i)=='}')
                flag2--;
            else if (line.charAt(i)=='[')
                flag3++;
            else if (line.charAt(i)==']')
                flag3--;
        }
        if (cnt1%2==0&&flag2==0&&flag3==0)
            System.out.println(true);
        else
            System.out.println(false);
    }
}
